#include<iostream>
using namespace std;

class Date {
public:
    Date(int num)
    {
        _day = num % 100;
        _month = num / 100 % 100;
        _year = num / 100 / 100;
    }

    bool LeadYear(const int year) {
        return ((!(year % 4) && (year % 100)) || !(year % 400));
    }

    bool operator>(const Date& d)const {
        return (_year > d._year) ||
            (_year == d._year && _month > d._month) ||
            (_year == d._year && _month == d._month && _day > d._day);
    }

    bool operator!=(const Date& d)const {
        return  (_year != d._year) ||
                (_month != d._month) ||
                (_day != d._day);
    }
    int GetDayOfMonth(const int year, const int month) {
        int days[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
        if (LeadYear(year))
            days[2] += 1;
        return days[month];
    }

    Date& operator++() {
        _day += 1 ;
        if (_day > GetDayOfMonth(_year, _month)) {
            _month++;
            _day = 1;
            if (_month > 12) {
                _year++;
                _month = 1;
            }
        }
        return *this;
    }
    bool operator==(const Date& d)const{
        return _year == d._year &&
               _month == d._month &&
               _day == d._day;
    }
    int operator-(const Date& d) {
        if(*this == d)
            return 0;
        Date min_date(*this);
        Date max_date(d);
        if (min_date > max_date) {
            min_date = d;
            max_date = *this;
        }
        int count = 0;
        while (min_date != max_date) {
            ++min_date;
            count++;
        }
        return count;
    }
private:
    int _year;
    int _month;
    int _day;
};
int main() {
    int num1,num2;
    cin >> num1 >> num2;
    Date d1(num1);
    Date d2(num2);
    int ret = d1 - d2;
    if(ret)
        cout << ret + 1 << endl;
    else
        cout << 0 <<endl;
    return 0;
}